sof="tomato_clock.sof"
elf="hello.elf"

echo "sof>flash ..."; sof2flash --epcs --input=$sof --output=sof.flash --quiet
echo "elf>flash ..."; elf2flash --epcs --after=sof.flash --input=$elf --output=elf.flash
echo "cat flash ..."; cat  elf.flash >> sof.flash
echo "flash>hex ..."; nios2-elf-objcopy --input-target srec --output-target ihex sof.flash generate.hex
echo "del flash ..."; rm -f *.flash